import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(home: PhysicalModelExample());
  }
}

class PhysicalModelExample extends StatefulWidget {
  @override
  _PhysicalModelExampleState createState() => _PhysicalModelExampleState();
}

class _PhysicalModelExampleState extends State<PhysicalModelExample> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('AnimatedPhysicalModel Demo')),
      body: Center(
        child: AnimatedPhysicalModel(
          child: Container(width: 300, height: 150),
          color: Colors.red,
          //阴影颜色
          shadowColor: Colors.yellow,
          //阴影高度
          elevation: 20,
          //圆角
          borderRadius: BorderRadius.all(Radius.circular(20)),
          //抗锯齿
          clipBehavior: Clip.antiAlias,
          duration: Duration(seconds: 1),
        ),
      ),
    );
  }
}
